package com.tengfei.reflection;

import java.util.Properties;

/**
 * @Description:
 * @author: ten_fei
 * @date: 2021-07-15 14:52
 */
public class Test5 {
    public static void main(String[] args) throws ClassNotFoundException {
        // 获取系统的类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);

        //获取系统类加载器的父类加载器-->扩展加载器
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);

        //获取扩展类加载器的父类加载器-->根加载器（c/c++）
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);

        //获取当前类的加载器
        ClassLoader classLoader = Class.forName("com.tengfei.reflection.Test5").getClassLoader();
        System.out.println(classLoader);

        //获取jdk自带类加载器
        ClassLoader classLoader1 = Class.forName("java.lang.Object").getClassLoader();
        System.out.println(classLoader1);

        //获取系统类加载路径
        String property = System.getProperty("java.class.path");
        System.out.println(property);

        /*
         * C:\jdk1.8.0_144\jre\lib\charsets.jar;
         * C:\jdk1.8.0_144\jre\lib\deploy.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;C:\jdk1.8.0_144\jre\lib\ext\dnsns.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\jaccess.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\localedata.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\nashorn.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\sunec.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;
         * C:\jdk1.8.0_144\jre\lib\ext\zipfs.jar;
         * C:\jdk1.8.0_144\jre\lib\javaws.jar;
         * C:\jdk1.8.0_144\jre\lib\jce.jar;
         * C:\jdk1.8.0_144\jre\lib\jfr.jar;
         * C:\jdk1.8.0_144\jre\lib\jfxswt.jar;C:\jdk1.8.0_144\jre\lib\jsse.jar;
         * C:\jdk1.8.0_144\jre\lib\management-agent.jar;
         * C:\jdk1.8.0_144\jre\lib\plugin.jar;
         * C:\jdk1.8.0_144\jre\lib\resources.jar;
         * C:\jdk1.8.0_144\jre\lib\rt.jar;
         * F:\java_idea\reflection\target\classes;
         * D:\Maven\apache-maven-3.6.3\mavenlocalRepository\junit\junit\4.11\junit-4.11.jar;
         * D:\Maven\apache-maven-3.6.3\mavenlocalRepository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;
         * D:\IntelliJ IDEA 2020.3.2\lib\idea_rt.jar
         * */
    }
}
